//
//  baseChoseJobKindsVC.swift
//  DingDongZP
//
//  Created by 三秒文化 on 16/4/26.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

import UIKit

<<<<<<< HEAD
class LDBaseChoseJobKindsVC: UITableViewController {
=======
class LDBaseChoseJobKindsVC: LDBaseCustomNavTabVC {
>>>>>>> dingdong2.1.0
    
    
    var model:baseChoseJobKindsCellModel?
    var paramsArr = [NSDictionary]()//NSMutableArray()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        setDefaultContent()
        
    }
    
    func setDefaultContent() {
        tableView.separatorStyle = UITableViewCellSeparatorStyle.None
        
        LDCheckPublicInfo.shareInstance.checkoutAllJobCategory { [weak self](data) in
            self?.paramsArr = data
            self?.tableView.reloadData()
        }
    }
}
extension LDBaseChoseJobKindsVC {
    
    override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
        return 1
    }
    
    override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return paramsArr.count
    }
    
    
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        var cell = tableView.dequeueReusableCellWithIdentifier("cellchose") as? LDBaseChoseJobKindsCell
        if cell == nil {
            cell = LDBaseChoseJobKindsCell.init(style: .Default, reuseIdentifier: "cellchose")
        }
        cell?.model = baseChoseJobKindsCellModel.yy_modelWithDictionary(paramsArr[indexPath.row] as [NSObject : AnyObject])
        return cell!
    }
    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        model = baseChoseJobKindsCellModel.yy_modelWithDictionary(paramsArr[indexPath.row] as [NSObject : AnyObject])
        return (model?.height)!
    }
    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
<<<<<<< HEAD
        let vc = LDBase2ChoseJobDetailsVC()
        model = baseChoseJobKindsCellModel.yy_modelWithDictionary(paramsArr[indexPath.row] as [NSObject : AnyObject])
        vc.chose2TitleArr = (model?.Level2Title)!
        vc.chose2TitleArr_ID = (model?.Level2Title_ID)!
        vc.paramsArr = model?.level2
        vc.title = model?.level1_name
        navigationController?.pushViewController(vc, animated: true)
=======
//        let vc = LDBase2ChoseJobDetailsVC()
//        model = baseChoseJobKindsCellModel.yy_modelWithDictionary(paramsArr[indexPath.row] as [NSObject : AnyObject])
//        vc.chose2TitleArr = (model?.Level2Title)!
//        vc.chose2TitleArr_ID = (model?.Level2Title_ID)!
//        vc.paramsArr = model?.level2
//        vc.title = model?.level1_name
//        navigationController?.pushViewController(vc, animated: true)
>>>>>>> dingdong2.1.0
    }
}
